import mongoose from 'mongoose';
import Kutils from '../modules/Kutils';

const kutil = new Kutils();
export const TABLE_NAME = 'app_upd_list';


function createdTime() {
    return +new Date();
}

function formatDate() {
    return kutil.dateFormat(new Date());
}

export const schema = new mongoose.Schema({
    createdTime: { type: Number, default: createdTime },
    updatedTime: { type: Number, default: createdTime },
    formatDate: { type: String, default: formatDate },
    type: String,
    cat: String,
    ver: String,
    url: String,
    md5: String,
    serialId: String,
}, { versionKey: false });

export const model = mongoose.model(TABLE_NAME, schema);
